subroutine geraA(m,no,T,hl,omega,lv,pol,u,w)

implicit none

integer                                    ::no,m
integer                                    ::lv
double precision,dimension(no,no)               ::T
double precision                           ::cte1,cte2
double precision                           ::fim
double precision,dimension(lv+1),intent(in)         ::hl
double precision                           ::omega
double precision,dimension(lv+1,no+2),intent(in)   ::pol
double precision                           ::pp,soma
double precision,dimension(no+1),intent(in)         ::u
double precision,dimension(no),intent(in)         ::w
integer                                    ::i,j,l

do i=1,no
   do j=1,no
      cte1=1/u(i)
      cte2=omega*cte1*w(j)/2.0d+00
      soma=0
      do l=m+1,lv+1
         pp=pol(l,i)*pol(l,j)
         soma=soma+hl(l)*pp

      enddo
      fim=cte2*soma
      if(i.eq.j) then
         T(i,j)=fim-cte1
      else
         T(i,j)=fim
      end if
   enddo
enddo
end
